import HjrButton from './components/HjrButton.vue'
import HjrInput from './components/HjrInput.vue'
import HjrCard from './components/HjrCard.vue'
import HjrModal from './components/HjrModal.vue'
import HjrSelect from './components/HjrSelect.vue'
import HjrSwitch from './components/HjrSwitch.vue'
import HjrAlert from './components/HjrAlert.vue'

// 组件列表
const components = [
  HjrButton,
  HjrInput,
  HjrCard,
  HjrModal,
  HjrSelect,
  HjrSwitch,
  HjrAlert
]

// 插件安装函数
const install = (app) => {
  components.forEach(component => {
    app.component(component.name, component)
  })
}

// 自动安装
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

// 导出插件
export default {
  install
}

// 导出单个组件
export {
  HjrButton,
  HjrInput,
  HjrCard,
  HjrModal,
  HjrSelect,
  HjrSwitch,
  HjrAlert
}
